<template>
   <div class="detail-logistics">
    <p>
      <span>{{list[0].text}}</span>
      <span>{{list[0].time}}</span>
    </p>
    <a href="javascript:;" @click="handlerLogistics(order)">查看物流</a>
  </div>
  <Teleport to="#model">
    <OrderLogistic ref="OrderLogistics"></OrderLogistic>
  </Teleport>
</template>

<script setup>
import { selectLogistics } from '@/api/order'
import {ref } from 'vue';
import OrderLogistic from './order-logistics'
import { useLogistics } from '../index'
const props = defineProps({
  order:{
    type: Object,
    default: () => ({})
  }
})
   const data = await selectLogistics(props.order.id)
   const list = ref(data.result.list)
   const { handlerLogistics, OrderLogistics} = useLogistics()
 
</script>

<style lang="scss" scoped>
.detail-logistics {
  height: 50px;
  display: flex;
  align-items: center;
  padding: 0 30px;
  background-color: #f5f5f5;
  margin: 30px 50px 0;
  > p {
    flex: 1;
    span {
      color: #999;
      &:first-child {
        margin-right: 30px;
      }
    }
  }
  > a {
    color: $xtxColor;
    text-align: center;
  }
}
</style>